import request from '@/utils/request'

const api = {
  page: '/leaveMessage/page',
  leaveMessage: '/leaveMessage'
}

export function getMsg (parameter) {
  return request({
    url: api.page,
    method: 'get',
    params: parameter
  })
}

export function saveMsg (parameter) {
  return request({
    url: api.leaveMessage,
    method: parameter.id === 0 ? 'post' : 'put',
    data: parameter
  })
}

export function deleteMsg (parameter) {
  return request({
    url: api.leaveMessage + `/${parameter.id}`,
    method: 'delete'
  })
}
